<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  	<link rel="stylesheet" href="<{$env.app.res_url}>/base.css" />
  	<link rel="stylesheet" href="<{$env.app.res_url}>/connect.css" />
  	<script type="text/javascript" src="<{$env.app.res_url}>/jquery-1.6.4.min.js"></script>
	<script type="text/javascript" src="<{$env.app.res_url}>/jquery.cookie.js"></script>
	<script type="text/javascript" src="<{$env.app.res_url}>/jquery.timers.js"></script>
	<script type="text/javascript" src="<{$env.app.res_url}>/jquery.utility.js"></script>
  	<script type="text/javascript" src="<{$env.app.res_url}>/j.tmpl.js"></script>
  	<script type="text/javascript" src="<{$env.app.res_url}>/j.select.js"></script>
  	<script type="text/javascript" src="<{$env.app.res_url}>/j.validate.js"></script>
  	<script type="text/javascript" src="<{$env.app.res_url}>/jquery.form.js"></script>
	<title>绑定关系</title>
 </head>

 <body><div class="app-connect">
	<form id="J_connect" class="form-horizontal" action="index.php?app=esb&ctl=site_bind&act=applyBind" method="post" >
		<input type="hidden" name="ajax" value="1" />
		<!-- 隐藏参数 -->
		
				<input type="hidden" name="from_certi_id" value="<{$p.certi_id}>" />
				<input type="hidden" name="callback" value="<{$p.callback}>" />
				<input type="hidden" name="node_id" value="<{$p.node_id}>" />
				<input type="hidden" name="api_url" value="<{$p.api_url}> " />
				<input type="hidden" name="op_id" value="<{$p.op_id}>" />
				<input type="hidden" name="op_user" value="<{$p.op_user}>" />
				<input type="hidden" name="session_back" value="<{$session_callback}>" />
				<input type="hidden" name="from_node_type" value="<{$from_node_type}>" />
				<input type="hidden" name="certi_ac" value="<{$p.certi_ac}>" />
		
		<!-- 绑定开始 -->
		<div class="control-group"  >
			<div class="control-label">
				<em class="red">*</em> 店铺类型：
			</div>
			<div class="controls">
				<select name="node_type" required="true" id="J_selType">
<option label="selfshop" value="selfshop" selected="selected">独立网店</option>
<option label="拍拍" value="paipai">拍拍</option>
<option label="淘宝" value="taobao">淘宝</option>
<option label="一号店" value="yihaodian">一号店</option>
<option label="QQ网购" value="qq_buy">QQ网购</option>
<option label="京东商城" value="360buy">京东商城</option>
<!-- <option label="百世物流" value="800best">百世物流</option>
<option label="标杆物流" value="bml">标杆物流</option>
<option label="发网物流" value="fineex">发网物流</option>
<option label="科捷物流" value="kejie">科捷物流</option>
<option label="酷武物流" value="smtkw">酷武物流</option>
<option label="毅龙物流" value="elong">毅龙物流</option> -->
</select>

			</div>
		</div>
				<hr />
				<div id="J_msgs"></div>
		<div id='bind_content'>
			<div id="J_selCont">
				<!-- 根据选择的节点类型变化 -->
			</div>
			<div class="form-actions">
				<input type="submit" class="btn btn-primary" id="btn_apply_bind"  value=" 绑 定" />
			</div>
		</div>
	</form>
</div>

<!-- 初始表单数据 -->
<div style="display:none" id="selfshop-form">
		<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>网店URL：
		</div>
		<div class="controls">
			<input type="text" name="url" id="url" class="input-medium required" tip="网店URL" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>网店API：
		</div>
		<div class="controls">
			<input type="text" name="api" id="api" class="input-medium required" tip="网店API" />
			<span></span>
		</div>
	</div>
		<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>网店名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" tip="网店名称" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>网店描述：
		</div>
		<div class="controls">
			<textarea name="shop_name" id="shop_name" class="input-medium required" tip="网店名称" ></textarea>
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	
	</div>
<!-- public表单数据 -->
<div style="display:none" id="public-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>应用名称ddd：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" tip="应用名称" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>APP KEY：
		</div>
		<div class="controls">
			<input type="text" name="to_node" id="to_node" class="input-medium required" tip="APP KEY" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>SECRET：
		</div>
		<div class="controls">
			<input type="text" name="to_token" id="to_token" class="input-medium required" tip="SECRET" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	</div>

<!-- 易趣节点信息块 -->
<div style="display:none" id="ebay-form">
	<input type="hidden" name="level" value="699" />
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>ebay店铺token：
		</div>
		<div class="controls">
			<textarea name="ebay_token" id="ebay_token" class="input-medium required" tip="ebay店铺token" rows="4" cols="30"></textarea>
			<span></span>
		</div>
	</div>
</div>

<!-- 淘宝节点信息块 -->
<div style="display:none" id="taobao-form">

	<input type="hidden" name="method" value='login' />
	<input type='hidden' value='taobao' name ='login_type' >
	<input type='hidden' value='taobao' name ='node_type' >
	<input type='hidden' value='' name ='taobao_type' >

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>淘宝帐号授权：
		</div>
		<div class="controls">
			<span class='red'><a href="index.php?app=app.login&login_type=taobao&node_type=taobao" target="_blank" onclick="show_tip();" ><img src="<{$env.app.res_url}>/login_taobao.png" alt="淘宝登录" /></a></span>
			<span class="tips"style="display:none;"><label for="qq" generated="true" class="error">登录淘宝,授权成功后,点击下一步操作</label></span>
		</div>
	</div>
</div>

<!-- 物流宝节点信息块 -->
<div style="display:none" id="wlb-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>淘宝帐号授权：
		</div>
		<div class="controls">
			<span class='red'><a href="index.php?app=app.login&login_type=taobao&node_type=wlb" target="_blank"><img src="<{$env.app.res_url}>/login_taobao.png" alt="淘宝登录" /></a></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'></span>
		</div>
		<div class="controls">
			<a href="javascript:void(0);" onClick="getWarehouse(this);" class="normal" tip="未登录淘宝、登录失败或登录过期" cookieKey="tb_login_status">获取仓库及用户信息</a>
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>商家类型：
		</div>
		<div class="controls">
			<select name="business_type" id="business_type" class="input-medium required" cookieKey="tb_user_type"></select>
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>淘宝登陆帐号：
		</div>
		<div class="controls">
			<input type="text" name="nickname" id="nickname" class="lock" title="登陆后显示" class="input-medium required" cookieKey="tb_user_nick" readonly />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>仓库：
		</div>
		<div class="controls">
			<select name="warehouse_code" class="input-medium required" id="warehouse_code"></select>
			<!--<input type="hidden" name="login_status" class="input-medium required" class="login_status" />-->
			<!--<a href="javascript:void(0);" onClick="getWarehouse(this);" class="normal" tip="未登录淘宝或登录淘宝失败" cookieKey="tb_login_status">获取可选仓库列表</a>-->
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			淘宝店铺地址：
		</div>
		<div class="controls">
			<input type="text" name="shop_url" id="shop_url" tip="淘宝店铺访问地址" value="http://" />
		</div>
	</div>
</div>

<!-- 拍拍节点信息块 -->
<div style="display:none" id="paipai-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>QQ号码：
		</div>
		<div class="controls">
			<input type="text" name="qq" id="qq" class="input-medium required" tip="QQ" />
			<span></span>
		</div>
	</div>

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>token(授权码)：
		</div>
		<div class="controls">
			<input type="text" name="ptoken" id="ptoken" class="input-medium required" tip="token" />
			<span></span>
			<span class='red'><a href="http://fuwu.paipai.com/my/app/getAppTempToken.xhtml?appId=58762" target="_blank">获取授权码</a></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>拍拍店铺地址：
		</div>
		<div class="controls">
			<input type="text" name="shop_url" id="shop_url" class="input-medium required" value="http://" />
		</div>
	</div>
</div>

<!-- 百世节点信息块 -->
<div style="display:none" id="800best-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>仓库：
		</div>
		<div class="controls">
			<select name="warehouse_code" class="input-medium required" tip="仓库">
<option label="上海淘宝仓" value="BEST_SH_TAOBAO_WH">上海淘宝仓</option>
</select>

			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>企业通行证号：
		</div>
		<div class="controls">
			<input type="text" name="uid" class="input-medium required lock" tip="企业通行证号" value="311110018716" readonly />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>显示名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">同步客户信息：</div>
	</div>
	<div class="controls">
		<span style="font-size:12px;">以下是同步客户信息到百世物流所需填写项(若是首次绑定,需要同步客户信息,可能会比较慢)</span>
		<a href="javascript:void(0);" onClick="showCustomer('800best_customer_info',$(this))" style="font-size:12px;">点击隐藏</a>
	</div>
	<!-- 客户信息同步 -->
	<div id="800best_customer_info">
		<div class="control-group">
			<div class="control-label">
				客户名称：
			</div>
			<div class="controls">
				<input type="text" name="customer_name" class="input-medium" />
				<span></span>
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				公司名称：
			</div>
			<div class="controls">
				<input type="text" name="company" />
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				联系人姓名：
			</div>
			<div class="controls">
				<input type="text" name="contact_name" />
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				电话号码：
			</div>
			<div class="controls">
				<input type="text" name="phone" />
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				手机：
			</div>
			<div class="controls">
				<input type="text" name="mobile" />
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				邮编：
			</div>
			<div class="controls">
				<input type="text" name="zipcode" />
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				联系地址：
			</div>
			<div class="controls">
				<input type="text" name="address" />
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				Email：
			</div>
			<div class="controls">
				<input type="text" name="email" />
			</div>
		</div>
	</div>
</div>

<!-- 酷武节点信息块 -->
<div style="display:none" id="smtkw-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>仓库：
		</div>
		<div class="controls">
			<select name="warehouse_code" class="input-medium required">
<option label="酷武4号仓（莲花仓）" value="KUWU-0004">酷武4号仓（莲花仓）</option>
<option label="昆山花桥仓" value="KW-HQC">昆山花桥仓</option>
</select>

			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>企业通行证号：
		</div>
		<div class="controls">
			<input type="text" name="uid" class="input-medium required lock" tip="企业通行证号" value="311110018716" readonly />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>显示名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">同步客户信息：</div>
	</div>
	<div class="controls">
		<span style="font-size:12px;">以下是同步客户信息到酷武物流所需填写项(若是首次绑定,需要同步客户信息,可能会比较慢)</span>
	</div>
	<!-- 客户信息同步 -->
	<div id='smtkw_customer_info'>
		<div class="control-group">
			<div class="control-label">
				客户名称：
			</div>
			<div class="controls">
				<input type="text" name="customer_name" class="input-medium" />
				<span></span>
			</div>
		</div>
		<div class="control-group">
			<div class="control-label">
				备注：
			</div>
			<div class="controls">
				<input type="text" name="remark" />
			</div>
		</div>
	</div>
</div>

<!-- 科捷节点信息块 -->
<div style="display:none" id="kejie-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>仓库：
		</div>
		<div class="controls">
			<select name="warehouse_code" class="input-medium required">
<option label="北京大兴仓" value="BJDX">北京大兴仓</option>
<option label="上海徐泾BTC仓" value="SHXJ">上海徐泾BTC仓</option>
<option label="广州茅岗仓" value="GZMG">广州茅岗仓</option>
</select>

			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>工厂编号：
		</div>
		<div class="controls">
			<input type="text" name="customer_id" class="input-medium required" tip="工厂编号" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>公司编号：
		</div>
		<div class="controls">
			<input type="text" name="company_id" class="input-medium required" tip="公司编号" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>物料组编号：
		</div>
		<div class="controls">
			<input type="text" name="group_id" class="input-medium required" tip="物料组编号" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>显示名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
</div>

<!-- 支付宝节点信息块 -->
<div style="display:none" id="alipay-form">
	<!--
	<div class="control-group">
	<div class="control-label"><span class='red'>*</span>登录支付宝</div>
	<div class="controls">
	<span class='red'><a href="index.php?app=app.login&login_type=alipay" target="_blank"><img src="<{$env.app.res_url}>/login_alipay.png" alt="淘宝登录" /></a></span>
	</div>
	</div>
	-->
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>支付宝帐号：
		</div>
		<div class="controls">
			<input type="text" name="alipay_account" class="input-medium required" tip="支付宝帐号" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>合作者身份(parterID)：
		</div>
		<div class="controls">
			<input type="text" name="parter_id" class="input-medium required" tip="合作者身份(parterID)" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>安全校验码(key)：
		</div>
		<div class="controls">
			<input type="text" name="parter_key" class="input-medium required" tip="安全校验码(key)" />
			<span></span>
		</div>
	</div>
</div>

<!-- 京东节点信息块 -->
<div style="display:none" id="360buy-form">
	<input type="hidden" name="method" value='login' />

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>京东帐号授权：
		</div>
		<div class="controls">
			<span class='red'><a href="index.php?app=app.login&login_type=360buy&node_type=360buy" target="_blank" onclick="show_tip();" ><img src="<{$env.app.res_url}>/login_360buy.png" alt="京东登录" /></a></span>
			<span class="tips" style="display:none;"><label for="qq" generated="true" class="error">登录京东商城,授权成功后,点击下一步操作</label></span>
		</div>
	</div>
</div>

<!-- 发网节点信息块 -->
<div style="display:none" id="fineex-form">

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>仓库：
		</div>
		<div class="controls">
			<select name="warehouse_code" class="input-medium required">
<option label="发网上海金勺路4号仓库" value="8750">发网上海金勺路4号仓库</option>
<option label="发网上海金勺路10号仓库" value="8834">发网上海金勺路10号仓库</option>
</select>

			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>发网会员号：
		</div>
		<div class="controls">
			<input type="text" name="member_id" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>发网会员密钥：
		</div>
		<div class="controls">
			<input type="text" name="member_key" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>

</div>

<!-- 标杆物流节点信息块 -->
<div style="display:none" id="bml-form">

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>仓库：
		</div>
		<div class="controls">
			<select name="warehouse_code" class="input-medium required">
<option label="标杆昆山仓" value="BML_KSWH">标杆昆山仓</option>
</select>

			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>标杆会员号：
		</div>
		<div class="controls">
			<input type="text" name="customer_id" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>标杆会员密钥：
		</div>
		<div class="controls">
			<input type="text" name="customer_key" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" />
			<span></span>
		</div>
	</div>

</div>

<!-- 一号店节点信息块 -->
<div style="display:none" id="yihaodian-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>商家id：
		</div>
		<div class="controls">
			<input type="text" name="merchantId" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>商家key：
		</div>
		<div class="controls">
			<input type="text" name="checkCode" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" />
			<span></span>
		</div>
	</div>
</div>

<!-- 亚马逊节点信息块 -->
<div style="display:none" id="amazon-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>卖家编号：
		</div>
		<div class="controls">
			<input type="text" name="seller_id" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>商城编号：
		</div>
		<div class="controls">
			<input type="text" name="marketplace_id" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>访问密钥：
		</div>
		<div class="controls">
			<input type="text" name="aws_access_key_id" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>应用程序名称：
		</div>
		<div class="controls">
			<input type="text" name="app_name" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>密钥：
		</div>
		<div class="controls">
			<input type="text" name="secret_key" class="input-medium required" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" />
			<span></span>
		</div>
	</div>
</div>

<!-- qq网购节点信息块 -->
<div style="display:none" id="qq_buy-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>合作伙伴ID：
		</div>
		<div class="controls">
			<input type="text" name="cooperator_id" id="cooperator_id" class="input-medium required" tip="cooperator_id" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>qq号码：
		</div>
		<div class="controls">
			<input type="text" name="qq" id="qq" class="input-medium required" tip="qq" />
			<span></span>
		</div>
	</div>

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>token(授权码)：
		</div>
		<div class="controls">
			<input type="text" name="access_token" id="access_token" class="input-medium required" tip="accessToken" />
			<span></span>
			<span class='red'><a href="http://fuwu.paipai.com/my/app/getAppTempToken.xhtml?appOAuthID=700046494" target="_blank">获取授权码</a></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" id="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>拍拍店铺地址：
		</div>
		<div class="controls">
			<input type="text" name="shop_url" id="shop_url" class="input-medium required" />
		</div>
	</div>
</div>

<!-- elong节点信息块 -->
<div style="display:none" id="elong-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>会员号：
		</div>
		<div class="controls">
			<input type="text" name="customer_id" class="input-medium required" tip="会员号" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>会员密钥：
		</div>
		<div class="controls">
			<input type="text" name="customer_key" class="input-medium required" tip="会员密钥" />
			<span></span>
		</div>
	</div>

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>显示名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
</div>

<!-- dangdang节点信息块 -->
<div style="display:none" id="dangdang-form">
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>店铺编号：
		</div>
		<div class="controls">
			<input type="text" name="shop_id" class="input-medium required" tip="店铺编号" />
			<span></span>
		</div>
	</div>
	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>会员密钥：
		</div>
		<div class="controls">
			<input type="text" name="customer_key" class="input-medium required" tip="会员密钥" />
			<span></span>
		</div>
	</div>

	<div class="control-group">
		<div class="control-label">
			<span class='red'>*</span>显示名称：
		</div>
		<div class="controls">
			<input type="text" name="shop_name" class="input-medium required" />
			<span></span>
			<span class="red"></span>
		</div>
	</div>
</div>
</div>
<script>
	var Connect = {
		_type : $("#J_selType").val(),
		init : function() {
			this.form = $('#J_connect');
			this.sel = $('#J_selType');
			this.selCont = $('#J_selCont');
			this.sel.sSelect();

			this.render();
			this.bindEvents();
		},
		render : function() {
			if (this._type == 'taobao' || this._type == '360buy') {
				$('#btn_apply_bind').val('下一步');
				$('#btn_apply_bind').css("display", "none");
					$('.tips').css("display", "none");
			}
			else {
				$('#btn_apply_bind').val(' 绑 定 ');
				$('#btn_apply_bind').css("display", "inline-block");
			}

			var selCont = this.selCont;
			selCont.html($('#' + this._type + '-form').html());

			return this;
		},
		bindEvents : function() {
			var self = this;

			this.sel.change(function() {
				var val = $(this).val();
				if (self._type != val) {
					self._type = val;
					//self._type = $(this.options[this.options.selectedIndex]).attr('parent');
					self.render();
				}
			});

			this.form.submit(function(e) {
				e.preventDefault();
				var form = self.form;
				if (!form.valid()) {
					return false;
				}
				$('#btn_apply_bind').addClass('disabled');
				$('#btn_apply_bind').attr({disabled:"disabled"});
				var input_val = $('#btn_apply_bind').val();
				$('#btn_apply_bind').val('正在提交...');
				$(this).ajaxSubmit(function(res) {
					if (res.indexOf('alert-success') != -1 || res.indexOf('alert-error') != -1) {
						$('#J_msgs').html(res);
						if (res.indexOf('alert-success') != -1) {
							$('#bind_content').css("display", "none");
						}
						else{
							$('#btn_apply_bind').removeClass('disabled');
							$('#btn_apply_bind').attr({disabled:false});
							$('#btn_apply_bind').val(input_val);
						}
					}
					else {
						form[0].submit();
					}
				});
				return false;
			});
		}
	};

	$(function() {
		Connect.init();
	});
	/**
	 * 提示
	 *
	 */
	function clue(el, result, msg) {
		var cl;
		switch (result) {
			case 'succ' :
				cl = 'validsuccess';
				msg = msg || '&nbsp;';
				break;
			case 'error' :
			default :
				cl = 'validerror';
				break;
		}
		$(el).nextAll('span:first').attr('class', cl).html(msg);
	}

	function showCustomer(id, trigger) {
		var el = $('#' + id);
		if (el.css('display') == 'none') {
			tip = '点击隐藏';
		}
		else {
			tip = '点击展开';
		}
		trigger.html(tip);
		el.toggle('slow');
	}

	/**
	 * 获取可选仓库列表
	 *
	 */
	function getWarehouse(el) {
		if ($.cookie($(el).attr('cookieKey'))) {
			var nodeType = $('#J_selType').val();
			$.post('index.php?app=app.getAvailableWarehouse&node_type=' + nodeType, function(response) {
				//var sel = $(el).prevAll(':input[name=warehouse_code]');
				var store = $('#J_selCont #warehouse_code');
				var data = $.parseJSON(response);
				if (data.res == 'succ' && data.info.warehouse) {
					var optionHtml = '';
					$.each(data.info.warehouse, function(k, v) {
						optionHtml += '<option value="' + v.code + '">' + v.name + '</option>';
					});
					store.html(optionHtml);

					/* 根据类型处理相应信息 */
					switch (nodeType) {
						case 'wlb' :
							var nick = $('#J_selCont #nickname');
							nick.val($.cookie(nick.attr('cookieKey')));
							var biz = $('#J_selCont #business_type');
							var bizType = $.cookie(biz.attr('cookieKey'));
							biz.html('<option value="' + bizType + '">' + bizType + '商家</option>');
							$.each([biz, nick, store], function(k, v) {
								clue(v, 'succ', '');
							});
							break;
						default :
							break;
					}
					clue(el, 'succ', '获取成功');
				}
				else {
					clue(el, 'error', '获取可选仓库列表失败[' + (data.info.errorDescription || '') + ']');
				}
			});
		}
		else {
			clue(el, 'error', $(el).attr('tip'));
		}
	}

	/**
	 * 获取&&设置用户信息
	 *
	 */
	function getUserInfo(el) {
		if ($.cookie($(el).attr('cookieKey'))) {
			var nick = $('#J_selCont #nickname');
			nick.val($.cookie(nick.attr('cookieKey')));
			var fenxiao_type = $('#J_selCont #fenxiao_type');
			fenxiao_type.val($.cookie(fenxiao_type.attr('cookieKey')));
			var biz = $('#J_selCont #business_type');
			var bizType = $.cookie(biz.attr('cookieKey'));
			biz.html('<option value="' + bizType + '">' + bizType + '商家</option>');
			$.each([biz, nick], function(k, v) {
				clue(v, 'succ', '');
			});
			clue(el, 'succ', '获取成功');

			var fenxiao_type_val = fenxiao_type.attr('value');

			var fx = $("#tb_fx_order");
			var zx = $("#tb_zx_order");
			fx.show();
			zx.show();
			if (fenxiao_type_val == '') {
				fx.hide();
				if ($('#tb_zx_order .checkboxed').attr('value') != 'tb_zx_order') {
					// $(".checkboxError").attr('class','validerror').html('您的帐号不是淘宝分销帐号，无法订阅分销单服务，请确定帐号类型后重试。');
					$("#busiWrap").remove();
				}
			}
		}
		else {
			clue(el, 'error', $(el).attr('tip'));
		}
	}
	function show_tip(){
		$('#btn_apply_bind').css("display", "block");
		$('.tips').css("display", "inline-block");
	}
</script>
<style>
	.red {
		color: red;
		font-size: 12px;
		margin-left: 3px;
	}
</style>
<div class="Business" style="display:none;">
	<h4>已经接入的商家平台</h4>
	<ul>
						<li><img src="<{$env.app.res_url}>/360-logo.gif">
		</li>
				<li><img src="<{$env.app.res_url}>/qq-logo.gif">
		</li>
				<li><img src="<{$env.app.res_url}>/pp-logo.gif">
		</li>
				<li><img src="<{$env.app.res_url}>/tmall.gif">
		</li>
				<li><img src="<{$env.app.res_url}>/tb-logo.gif">
		</li>
				
	</ul>
</div>
</body>
</html>